//
// Created by pengtg on 2020/3/1.
//

#ifndef ANDROIDVIDEOPLAYER_IAUDIOPLAY_H
#define ANDROIDVIDEOPLAYER_IAUDIOPLAY_H


#include <list>
#include "IObserver.h"
#include "XParameter.h"

class IAudioPlay: public IObserver
{
public:
    //接收重采样的数据
    //缓冲满后阻塞
    virtual void Update(XData data);
    //获取缓冲数据，如没有则阻塞
    virtual XData GetData();
    virtual bool StartPlay(XParameter out) = 0;
    virtual void Close() = 0;
    virtual void Clear();
    //最大缓冲
    int maxFrame = 100;
    int pts = 0;

protected:
    std::list<XData> frames;
    std::mutex framesMutex;
};


#endif //ANDROIDVIDEOPLAYER_IAUDIOPLAY_H
